home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / TEMP / GNU / bison / Precedencg < prev    next >
Text File  |  1995-06-28  |  767b  |  33 lines

  1. Precedence Examples
  2. Previous: <Using Precedence=>UsingPrece> * Next: <How Precedence=>HowPrecede> * Up: <Precedence=>Precedencf>
  3.  
  4. #Wrap on
  5. {fH4}Precedence Examples{f}
  6.  
  7. In our example, we would want the following declarations:
  8.  
  9. #Wrap off
  10. #fCode
  11. %left '<'
  12. %left '-'
  13. %left '\*'
  14. #f
  15. #Wrap on
  16.  
  17. In a more complete example, which supports other operators as well, we
  18. would declare them in groups of equal precedence.  For example, {fCode}'+'{f} is
  19. declared with {fCode}'-'{f}:
  20.  
  21. #Wrap off
  22. #fCode
  23. %left '<' '>' '=' NE LE GE
  24. %left '+' '-'
  25. %left '\*' '\/'
  26. #f
  27. #Wrap on
  28.  
  29. (Here {fCode}NE{f} and so on stand for the operators for ``not equal''
  30. and so on.  We assume that these tokens are more than one character long
  31. and therefore are represented by names, not character literals.)
  32.  
  33.